/**
 * $Revision: 1.0 $
 * $Author: Eric Yang $
 * $Date: Aug 13, 2009 12:49:26 AM $
 *
 * Author: Eric Yang
 * Date  : Aug 13, 2009 12:49:26 AM
 *
 */
package com.gooex.web.action.organization.authority;

import java.util.ArrayList;
import java.util.List;

import com.gooex.domain.organization.Authority;
import com.gooex.domain.organization.Role;
import com.gooex.web.action.BaseProtectedAction;


/**
 * @author Eric Yang
 * @version 1.0
 */
public class ListAuthority extends BaseProtectedAction {

	public List<Authority> getAuthorities() {
		List<Authority> authorities = new ArrayList<Authority>();
		Role role = sessionContext.getUser().getRole();
		if (isSystemObject(role)) {
			authorities = authorityManager.getAuthorities();
		} else {
			authorities = role.getAuthorities();
		}
		return authorities;
	}
}
